Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not delete special member functions of Profile #551

Merged

Conversation

rjoomen
Copy link
Contributor

@rjoomen rjoomen commented Dec 18, 2024

Deleting these functions prevents code like this from working, as the loaded or create profile cannot be assigned to variable profile:

  std::shared_ptr<TimeOptimalParameterizationProfile> profile;
  try
  {
    profile = std::make_shared<TimeOptimalParameterizationProfile>(
        tesseract_common::Serialization::fromArchiveFileXML<TimeOptimalParameterizationProfile>(profile_path));
  }
  catch (const std::exception& ex)
  {
    RCLCPP_WARN_STREAM(logger, "Could not load profile " << profile_path.filename() << ": " << ex.what());
  }
  if (!profile)
  {
    // Create default profile
    profile = std::make_shared<TimeOptimalParameterizationProfile>(
        max_velocity_scaling_factor, max_acceleration_scaling_factor, max_jerk_scaling_factor, 0.1, 0.001);
  }

I think making the special functions protected is the right approach for an abstract base class.

@rjoomen rjoomen changed the title Do not delete special member functions Do not delete special member functions of Profile Dec 18, 2024
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.67%. Comparing base (b5d897f) to head (aad0fe6).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #551   +/-   ##
=======================================
  Coverage   78.67%   78.67%           
=======================================
  Files         251      251           
  Lines       14746    14746           
=======================================
  Hits        11602    11602           
  Misses       3144     3144           

see 2 files with indirect coverage changes

@Levi-Armstrong Levi-Armstrong merged commit 51f87af into tesseract-robotics:master Dec 18, 2024
8 of 12 checks passed
@rjoomen rjoomen deleted the profile_special_functions branch December 19, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants